package com.example.quality.chapter3;

/**
 * @Date 2023-05-13
 * @Author Jonathan
 */
public class Person {

    private String name;

    private Home home;

    public Person(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Home getHome() {
        return home;
    }

    public void setHome(Home home) {
        this.home = home;
    }

    /**
     * 使用静态内部类：
     * 1.提高封装性
     * 2.提高代码的可读性
     * 3.形似内部，神似外部
     */
    public static class Home {
        private String address;
        private String tel;

        public Home(String address, String tel) {
            this.address = address;
            this.tel = tel;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getTel() {
            return tel;
        }

        public void setTel(String tel) {
            this.tel = tel;
        }
    }
}
